package yz.cp.back.s.service;

import com.baomidou.mybatisplus.extension.service.IService;
import yz.cp.back.s.entity.SysPermission;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jobob
 * @since 2019-04-03
 */
public interface ISysPermissionService extends IService<SysPermission> {

    /**
     * 通过用户id获取
     * @param userId
     * @return
     */
    List<SysPermission> findByUserId(String userId);
    /**
     * 通过层级查找
     * 默认升序
     * @param level
     * @return
     */
    List<SysPermission> findByLevelOrderBySortOrder(Integer level);

    /**
     * 通过parendId查找
     * @param parentId
     * @return
     */
    List<SysPermission> findByParentIdOrderBySortOrder(String parentId);

    /**
     * 通过类型和状态获取
     * @param type
     * @param status
     * @return
     */
    List<SysPermission> findByTypeAndStatusOrderBySortOrder(Integer type, Integer status);

    /**
     * 通过名称获取
     * @param title
     * @return
     */
    List<SysPermission> findByTitle(String title);

    /**
     * 模糊搜索
     * @param title
     * @return
     */
    List<SysPermission> findByTitleLikeOrderBySortOrder(String title);
}
